/**
 *  为IbaseService的参数做校验的
 * @param params
 */
export const valiObj = (params: object): boolean => {
  if (!params || Object.keys(params).length === 0) {
    return false;
  }
  return true;
};
/* export const valiArray = (params: []): boolean => {
  if (!params || !Array.isArray(params) || params.length === 0) {
    return false;
  }
  return true;
}; */
export const valiPositvieNumber = (params: any): boolean => {
  if (!params || !/^[1-9]d*$/.test(String(params))) {
    return false;
  }
  return true;
};

/**
 * 验证大于0的正整数
 * @param params 
 */
export const valiGreaterThanZeroInteger = (
  params: string | number,
): boolean => {
  if (!params) return false;
  if (!/^([1-9][0-9]*){1,3}/.test(String(params))) {
    return false;
  }
  return true;
};
